package net.pimpas.report.processor.condition.impl;

import net.pimpas.report.processor.exception.ConditionException;
import net.pimpas.report.processor.field.Field;
import net.pimpas.report.processor.resolver.FieldPropertyResolver;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

public class ILikeCondition extends LikeCondition {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6822319087679184337L;

	public ILikeCondition(Field field, Object value) {
		super(field, value);
	}
	
	@Override
	public Criterion process(String fieldAlias, FieldPropertyResolver resolver) throws ConditionException {
		return Restrictions.ilike(fieldAlias, this.getValue());
	}
}